import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/Home.vue'
const Login = ()=>import("../views/login/Login.vue")
const Register = ()=>import("../views/login/register.vue")
const Blog = ()=>import("../views/blog/blog.vue")
const BlogDetail = ()=>import("../views/blog/blogWrite.vue")
const File = ()=>import("../views/file/file.vue")
const BlogRead = ()=>import("../views/blog/blogContent.vue")
const Site = ()=>import("../views/site/site.vue")
const Video = ()=>import("../views/video/friend.vue")
const Mine = ()=>import("../views/mine/mine.vue")
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    redirect:'/home'
  },
  {
    path:"/home",
    name:"Home",
    component:Home,
    children:[
      {path:"/blog",name:"Blog",component:Blog},
      {path:"/blogRead/:id",name:"BlogDetail",component:BlogRead},
      {path:"/write",name:"Detail",component:BlogDetail},
      {path:"/file",name:"File",component:File},
      {path:"/site",name:"Site",component:Site},
      {path:"/video",name:"Video",component:Video},
      {path:"/mine",name:"Mine",component:Mine}
    ]
  },
  {
    path:"/login",
    name:"Login",
    component:Login
  },
  {
    path:"/register",
    name:"Register",
    component:Register
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
